
#include "cmsis_os.h"  // CMSIS RTOS header file
#include "mb.h"
#include "App_Communiction.h"
/*----------------------------------------------------------------------------
 *      Thread 1 'Thread_Name': Sample thread
 *---------------------------------------------------------------------------*/

void Communiction_proc(void const *argument)
{
    MBRegsiterInit();
    eMBInit(MB_RTU, MBGetAddrsee(), USART0_CH, MBGetBaudrate(), MB_PAR_NONE);
    eMBEnable();

    while (1)
    {
        eMBPoll();            // MB状态处理
        MBResolve();          // MB处理
        MBRegsiterUpdate(1);  // MB数据更新
        osDelay(10);
    }
}
